﻿// <copyright file="MetadataStore.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2009-12-05</date>
// <summary>MetadataStore class definition</summary>

namespace Microsoft.WebAnalytics.Media.Design
{
    using System.ComponentModel;
    using Microsoft.WebAnalytics.Design.Editors;
    using Microsoft.Windows.Design;
    using Microsoft.Windows.Design.Metadata;

    /// <summary>
    /// Design-time metadata store
    /// </summary>
    public class MetadataStore : IProvideAttributeTable
    {
        #region IProvideAttributeTable Members

        /// <summary>
        /// Gets the attribute table for metadata about the Microsoft.WebAnalytics.SSME assembly
        /// </summary>
        public AttributeTable AttributeTable
        {
            get
            {
                AttributeTableBuilder builder = new AttributeTableBuilder();

                builder.AddCustomAttributes(
                    typeof(TrackPlayer),
                    new DescriptionAttribute(Properties.Resources.TrackPlayerDescription),
                    new EditorAttribute(typeof(AnalyticsCategoryEditor), typeof(AnalyticsCategoryEditor)),
                    new ToolboxCategoryAttribute(Properties.Resources.Analytics));

                builder.AddCustomAttributes(
                    typeof(TrackPlayer),
                    "Log",
                    BrowsableAttribute.No);

                builder.AddCustomAttributes(
                    typeof(TrackPlayer),
                    "CustomProperties",
                    new CategoryAttribute(Properties.Resources.Analytics),
                    new DisplayNameAttribute(Properties.Resources.CustomProperties));

                return builder.CreateTable();
            }
        }

        #endregion
    }
}
